import request from "../utils/request.js";


// 获取购物车列表
export const getAllCarts = () => {
    return request({
        method:'get',
        url:'/api/v1/sale/query_product_list',
    })
}

// 下单
export const order = (productId) => {
    return request({
        method:'post',
        url:'/api/v1/sale/create_pay_order',
        params:{
            productId
        }
    })
}

export const compositionWritingAPI = (msg) => {
    let model = window.localStorage.getItem('gpt')
    return request({
        url: "/api/v1/chat/essay/init",
        method:"post",
        data: {
            model: model,
            title: msg,
            controller: "false"
        }

    })
}


export const textPolishingAPI = (msg) => {
    return request({
        url:"/api/v1/chat/article/edit",
        method:"post",
        data:{
            "model": "ChatGPTModel.GPT_3_5_TURBO.getCode()",
            "messages": msg,
            "controller": "false"
        }
    })
}

export const  shortVideoScriptAPI = (msg) => {
    return request({
        url:"",
        method:"post",
        data:{
            "model": "ChatGPTModel.GPT_3_5_TURBO.getCode()",
            "messages": msg,
            "controller": "false"
        }
    })
}


